from fastapi import APIRouter

from core.rag_core import rag_query_by_file, rag_query_map_reduce
from entity.schema.model_schema import BaseModelInput
from utils.base_response import BaseResponse

rag=APIRouter()

@rag.post("/chat")
async def rag_query(input:BaseModelInput):
    message=await rag_query_map_reduce(input.user_input)
    return BaseResponse(code=200,message="成功",data=message)